var mongoose = require('mongoose');
mongoose.Promise = global.Promise;

var db = mongoose.createConnection('localhost', 'example1_test4')

db.on('error', console.error.bind(console, '连接错误:'))
db.once('open', function () {
var PersonScheam = new mongoose.Schema({
    name: String
})

var PersonModel = db.model('Person', PersonScheam);

var personEntity = new PersonModel({
    name: {}
})

personEntity.save()
    .then(function(){
        PersonModel.find(function (err, persons) {
            console.log(persons)
        })
    })

})